import React from "react";
import { PERM } from "./permissions";
import { routesPath } from "./routesPath";
import {
    OrganizationsIcon,
    DepartmentsIcon,
    PersonIcon,
    MonitoringIcon,
    UsersIcon,
    AuditIcon,
    ReportIcon
} from "../images/index";
import { IRoute } from "../types/routeType";

/**
 * Массив объектов с данными для роутинга.
 * @type { IRoute[] }
 */
export const routes: IRoute[] = [
    {
        allowed: [PERM.ORGANIZATIONS_VIEW, PERM.ORGANIZATIONS_CREATE, PERM.ORGANIZATIONS_UPDATE],
        path: routesPath.organizations.path,
        route: {
            render: () => <span>Отображение организаций</span>
        },
        element: {
            label: "Организации",
            icon: <OrganizationsIcon />
        }
    },
    {
        allowed: [PERM.DEPARTMENT_VIEW, PERM.DEPARTMENT_CREATE, PERM.DEPARTMENT_UPDATE],
        path: routesPath.departments.path,
        route: {
            render: () => <span>Отображение отделов</span>
        },
        element: {
            label: "Отделы",
            icon: <DepartmentsIcon />
        }
    },
    {
        allowed: [PERM.ACCOUNTS_VIEW, PERM.ACCOUNTS_CREATE, PERM.ACCOUNTS_UPDATE],
        path: routesPath.accounts.path,
        route: {
            render: () => <span>Отображение учетных записей</span>
        },
        element: {
            label: "Учетные записи",
            icon: <PersonIcon />
        }
    },
    {
        allowed: [PERM.MONITORING_VIEW],
        path: routesPath.monitoring.path,
        route: {
            render: () => <span>Мониторинг</span>
        },
        element: {
            label: "Мониторинг",
            icon: <MonitoringIcon />
        }
    },
    {
        allowed: [PERM.REPORTS_VIEW],
        path: routesPath.reports.path,
        route: {
            render: () => <span>Отображение отчетов</span>
        },
        element: {
            label: "Отчеты",
            icon: <ReportIcon />
        }
    },
    {
        allowed: [PERM.AUDIT_VIEW],
        path: routesPath.audit.path,
        route: {
            render: () => <span>Аудит</span>
        },
        element: {
            label: "Аудит",
            icon: <AuditIcon />
        }
    },
    {
        allowed: [PERM.SYS_USER_VIEW, PERM.SYS_USER_CREATE, PERM.SYS_USER_UPDATE],
        path: routesPath.users.path,
        route: {
            render: () => <span>Отображение пользователей</span>
        },
        element: {
            label: "Пользователи",
            icon: <UsersIcon />
        }
    }
]